﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class KMD
    {
        public KMD()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;

            InitializeComponent();
            
        }
        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //base.Window_Loaded(sender, e);
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            //base.vwMaster_CurrentChanged(sender, e);
        }
        private void MDCommand(object sender, RoutedEventArgs e)
        {
            

            dwData = TBMain.NewRow();
            dwData["SDSA"] = "9200";
            dwData["SDKEY"] = "";
            SResult = TMV.QuerySDDAT(dwData, 9200);
            if (SResult.Tables[0].Rows.Count == 0)
            {
                dwData = TBMain.NewRow();
                TMV.SetUpNewRow(ref dwData, "9200");
                dwData["SDSA"] = "9200";
                dwData["SDKEY"] = "00E                     ";
                dwData["SDDATEN"] = "AINTERNAL PRODUCTION                               INTERNAL  000000E 456                                                               XKV     20150318        000000000000*";
                TMV.InsertSDDAT(dwData);
                dwData = TBMain.NewRow();
                TMV.SetUpNewRow(ref dwData, "9200");
                dwData["SDSA"] = "9200";
                dwData["SDKEY"] = "00F                     ";
                dwData["SDDATEN"] = "AEXTERNAL PRODUCTION                               EXTERNAL  000000F 456                                                               XKV     20150318        000000000000*";
                TMV.InsertSDDAT(dwData);
                dwData = TBMain.NewRow();
                TMV.SetUpNewRow(ref dwData, "9200");
                dwData["SDSA"] = "9200";
                dwData["SDKEY"] = "00Z                     ";
                dwData["SDDATEN"] = "APURCHASE                                          PURCHASE  000000Z 456                                                               XKV     20150318        000000000000*";
                TMV.InsertSDDAT(dwData);
                dwData = TBMain.NewRow();
                TMV.SetUpNewRow(ref dwData, "9200");
                dwData["SDSA"] = "9200";
                dwData["SDKEY"] = "00L                     ";
                dwData["SDDATEN"] = "ACOMMISSION                                        COMMISSION000000E 456                                                               XKV     20150318        000000000000*";
                TMV.InsertSDDAT(dwData);
                dwData = TBMain.NewRow();
                TMV.SetUpNewRow(ref dwData, "9200");
                dwData["SDSA"] = "9200";
                dwData["SDKEY"] = "00B                     ";
                dwData["SDDATEN"] = "ACUSTOMER SUPPLIED                                 CUSTOMER  000000E 456                                                               XKV     20150318        000000000000*";
                TMV.InsertSDDAT(dwData);
                dwData = TBMain.NewRow();
                TMV.SetUpNewRow(ref dwData, "9200");
                dwData["SDSA"] = "9200";
                dwData["SDKEY"] = "00X                     ";
                dwData["SDDATEN"] = "APRODUCE OR BY                                     BOTH      000000E 456                                                               XKV     20150318        000000000000*";
                TMV.InsertSDDAT(dwData);
            }
        }

    }
}
